//
//  contactViewController.m
//  easystudy
//
//  Created by 七 on 16/8/30.
//  Copyright © 2016年 kane. All rights reserved.
//

#import "contactViewController.h"

@interface contactViewController ()

@end

@implementation contactViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)backBtn:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)telephone:(id)sender {
    NSString *tel = @"4006511951";
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[@"telprompt://" stringByAppendingString:[[tel componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:@"0123456789"] invertedSet]] componentsJoinedByString:@""]]]];
}

- (IBAction)email:(id)sender {
    NSMutableString *mailUrl = [[NSMutableString alloc] init];
    NSArray *toRecipients = @[@"nfo@51aiya.con"];
    [mailUrl appendFormat:@"mailto:%@", toRecipients[0]];
     NSArray *ccRecipients = @[@"905207919@qq.com"];
    [mailUrl appendFormat:@"?cc=%@", ccRecipients[0]];
    [mailUrl appendString:@"&subject=my email"];
    [mailUrl appendString:@"&body=<b>Hello</b> World!"];
    NSString *emailPath = [mailUrl stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailPath]];
}


@end
